package com.youlu.campus.entity;

import com.youlu.campus.base.base.EntityBase;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 短链接配置
 */
@Getter
@Setter
@Document(collection = "short_url_config")
public class ShortUrlConfig extends EntityBase {
    private String name;
    private String desc;
    private Date expireTime;
    /**
     * A:活动,P:收款,QQ:qq群,Wechat:微信群,Email:邮件,Other:其他
     */
    private String type = "Other";
    /**
     * 平台,H5、APP、Wechat-Mini、QQ-Mini、App-iOS、App-Andriod
     */
    private String platform;
    /**
     * 操作人
     */
    private String optLoginName;
    /**
     * 长链接
     */
    private String longUrl;
    /**
     * 短链接
     */
    private String shortUrl;
    /**
     * 域名
     */
    private String domain;
    /**
     * Key
     */
    @Indexed(unique = true)
    private String key;
    /**
     * 操作日志
     */
    private List<String> optLogs = new ArrayList<>();
    @Transient
    private Long counter;

}
